//
//  PzNorPhotoTableCell.swift
//  CUYuYinFang
//
//  Created by 蓝鳍互娱 on 2023/10/26.
//  Copyright © 2023 lixinkeji. All rights reserved.
//

import UIKit
class PzNorPhotoTableCell: UITableViewCell {
    var photoSubDic:NSDictionary?{
        didSet{
            photoTypeNameLab.text = photoSubDic?["name"] as? String
            photoTypeWLab.text = photoSubDic?["specs1"] as? String
            photoTypeHLab.text = photoSubDic?["specs2"] as? String
            photoTypeRemarkLab.text = "要求：彩色正面免冠头像，头部占照片尺寸的2/3，白色背景，无边框，人像清晰，层次丰富，神态自然"
        }
    }
    lazy var photoBgView: UIView = {
        let view = UIView()
        view.layer.cornerRadius = 20.fitScale()
        view.clipsToBounds = true
        view.backgroundColor = UIColor(hex: 0x7D57A4,transparency: 0.36)
        return view
    }()
    lazy var photoTypeNameLab: UILabel = {
        let label = UILabel()
        label.font = UIFont.systemFont(ofSize: 32.fitScale(), weight: .regular)
        label.textColor = UIColor(hex: 0xD5C2EA)
        return label
    }()
    lazy var photoTypeWHeadImgView: UIImageView = {
        let imgView = UIImageView()
        imgView.image = UIImage(named: "pz_photoPx")
        return imgView
    }()
    lazy var photoTypeWLab: UILabel = {
        let label = UILabel()
        label.font = UIFont.systemFont(ofSize: 24.fitScale(), weight: .regular)
        label.textColor = UIColor(hex: 0xD5C2EA)
        return label
    }()
    lazy var photoTypeHHeadImgView: UIImageView = {
        let imgView = UIImageView()
        imgView.image = UIImage(named: "pz_photoPt")
        return imgView
    }()
    lazy var photoTypeHLab: UILabel = {
        let label = UILabel()
        label.font = UIFont.systemFont(ofSize: 24.fitScale(), weight: .regular)
        label.textColor = UIColor(hex: 0xD5C2EA)
        return label
    }()
    lazy var photoTypeRemarkLab: UILabel = {
        let label = UILabel()
        label.numberOfLines = 0
        label.font = UIFont.systemFont(ofSize: 24.fitScale(), weight: .regular)
        label.textColor = UIColor(hex: 0x80689F)
        return label
    }()
    lazy var photoImgView: UIImageView = {
        let imgView = UIImageView()
        imgView.image = UIImage(named: "pz_photo")
        return imgView
    }()
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.backgroundColor = .clear
        self.selectionStyle = .none
        
        self.contentView.addSubview(photoBgView)
        photoBgView.addSubview(photoTypeNameLab)
        photoBgView.addSubview(photoTypeWHeadImgView)
        photoBgView.addSubview(photoTypeWLab)
        photoBgView.addSubview(photoTypeHHeadImgView)
        photoBgView.addSubview(photoTypeHLab)
        photoBgView.addSubview(photoTypeRemarkLab)
        photoBgView.addSubview(photoImgView)

        photoBgView.snp.makeConstraints { make in
            make.left.equalTo(30.fitScale())
            make.right.equalTo(-30.fitScale())
            make.top.equalTo(0.fitScale())
            make.bottom.equalTo(-24.fitScale())
        }
        photoTypeNameLab.snp.makeConstraints { make in
            make.left.equalTo(31.fitScale())
            make.top.equalTo(29.fitScale())
            make.height.equalTo(45.fitScale())
        }
        photoTypeWHeadImgView.snp.makeConstraints { make in
            make.left.equalTo(32.fitScale())
            make.top.equalTo(photoTypeNameLab.snp.bottom).offset(18.fitScale())
            make.height.equalTo(29.fitScale())
            make.width.equalTo(57.fitScale())
        }
        photoTypeWLab.snp.makeConstraints { make in
            make.left.equalTo(photoTypeWHeadImgView.snp.right).offset(3.fitScale())
            make.centerY.equalTo(photoTypeWHeadImgView)
            make.height.equalTo(34.fitScale())
        }
        photoTypeHHeadImgView.snp.makeConstraints { make in
            make.left.equalTo(photoTypeWLab.snp.right).offset(44.fitScale())
            make.centerY.equalTo(photoTypeWHeadImgView)
            make.height.equalTo(29.fitScale())
            make.width.equalTo(57.fitScale())
        }
        photoTypeHLab.snp.makeConstraints { make in
            make.left.equalTo(photoTypeHHeadImgView.snp.right).offset(3.fitScale())
            make.centerY.equalTo(photoTypeWHeadImgView)
            make.height.equalTo(34.fitScale())
        }
        photoTypeRemarkLab.snp.makeConstraints { make in
            make.left.equalTo(31.fitScale())
            make.right.equalTo(-31.fitScale())
            make.top.equalTo(photoTypeHHeadImgView.snp.bottom).offset(32.fitScale())
            make.bottom.equalTo(-27.fitScale())
        }
        photoImgView.snp.makeConstraints { make in
            make.right.equalTo(-24.fitScale())
            make.top.equalTo(28.fitScale())
            make.width.equalTo(46.fitScale())
            make.height.equalTo(46.fitScale())
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
